﻿@model List<TestSystem.Model.ExaminationSetup>
@{
    ViewData["Title"] = "活动列表";
    Layout = "~/Views/Shared/_LayoutHUI.cshtml";
}

<header class="hui-header">
    <div id="hui-back"></div>
    <h1>活动列表</h1>
</header>

<div class="hui-wrap">
    @if (Model.Count() <= 0)
    {
        <div class="hui-common-title" style="margin-top:15px;">
            <div class="hui-common-title-line"></div>
            <div class="hui-common-title-txt">暂无活动！</div>
            <div class="hui-common-title-line"></div>
        </div>
    }
    else
    {
        @foreach (var item in Model)
        {
            <div class="hui-list" style="margin-top:22px;box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19);">
                <a onclick="gotopage('@item.ID')" style="height:auto; height:80px; padding-bottom:8px;">
                    <div class="hui-list-icons" style="width:110px; height:80px;">
                        <img />
                        <img src="~/images/icon/答题活动.png" style="width:66px; margin:0px; border-radius:50%;" />
                    </div>
                    <div class="hui-list-text" style="height:79px; line-height:79px;">
                        <div class="hui-list-text-content">
                            @item.Title
                        </div>
                        <div class="hui-list-info">
                            <span class="hui-icons hui-icons-right"></span>
                        </div>
                    </div>
                </a>
                <a href="javascript:hui.toast('Hello Hcoder UI !');">
                    <div class="hui-list-text">
                        活动时间： @item.StrTime.ToLongDateString() ~ @item.EndTime.ToLongDateString()
                    </div>
                </a>
            </div>
        }
    }
</div>

@section Scripts{

    <script>
    function gotopage(id) {
        //var username = localStorage.getItem("username");
        //var unitwork = localStorage.getItem("unitwork");
        //var href = '/AvoidTheLoginTest/GetTestPaper?id=' + id + '&&username=' + username + '&&unitwork=' + unitwork;
        localStorage.setItem("hdid", id);
        var href = '/AvoidTheLoginTest/SignUp';
        window.location.href = href;
    }
    </script>
}